package Test05;

public class FindLeapYears {
    public static void main(String[] args) {
        int flag = 0;
        for (int i = 1000; i <= 2000; i++) {
            if (i % 400 == 0 || (i % 100 != 0 && i % 4 == 0)) {
                System.out.print(i + " ");
                flag++;
            }
            if (flag % 30 == 0) {
                System.out.println();
            }
        }
    }
}
